package behavioral_pattern.Interpreter_pattern;

public class ActionNode extends AbstractMode{
    private String action;

    public ActionNode(String action) {
        this.action = action;
    }

    @Override
    public String interpret() {
        if (action.equalsIgnoreCase("move")){
            return "移动";
        }else if (action.equalsIgnoreCase("run")){
            return "快速移动";
        }
        return "无效指令";
    }
}
